package com.feng.seata.web;

import com.feng.common.model.Result;
import com.feng.seata.service.ProductService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/products")
@RestController
public class ProductController {

    @Resource
    private ProductService productService;

    @PutMapping("/minus/stock")
    public Result<?> minusStock(@RequestParam Integer buyNum) {
        productService.minusStock(buyNum);
        return Result.ok();
    }

}
